<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			const laowang = {
				love:"我喜欢你"
			}
			
			function sendSister(obj){
				console.log(obj.love);
				return "滚"
			}
			
			console.log(sendSister(laowang))
			
			
			const xiaowang = {
				love:"我喜欢你"
			}
			
			Object.defineProperty(xiaowang,'love',{
				get(){
					console.log("请小姐姐看电影")
					console.log("请小姐姐吃饭")
					return "我喜欢你"
				}
			})
			
			
			function sendxjj(obj){
				console.log(obj.love);
				return "我也喜欢你"
			}
			
			console.log(sendxjj(xiaowang))
			
			
			// proxy es6
			let laochen = {
				love:"曾经有一段真挚的爱情摆在我前面..."
			}
			
			const laochenProxy = new Proxy(laochen,{
				get(target,key){
					if(key==='love'){
						console.log("直接买包包")
						return target[key]
					}
				}
			})
			
			
			function sendxjj2(obj){
				console.log(obj.love);
				return "我们去领证吧"
			}
			
			console.log(sendxjj2(laochenProxy))
			
		</script>
	</body>
</html>
